package com.file.system.mapper.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.file.system.entity.system.WebDepartmentUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 部门关联账号 Mapper 接口
 *
 * @author jch
 * @since 2022-08-04
 */
@Mapper
public interface WebDepartmentUserMapper {

    //添加部门关联账号
    int save(WebDepartmentUser webDepartmentUser);

    //编辑部门关联账号
    int update(@Param("ew") UpdateWrapper<WebDepartmentUser> query);

    //编辑部门关联账号
    int updateById(WebDepartmentUser webDepartmentUser);

    //添加部门关联账号(批量)
    int saveBatch(@Param("list") List<WebDepartmentUser> webDepartmentUserList);

    //通过id删除部门关联账号
    int removeById(@Param("fkUserId") Long fkUserId);

    //通过id查询部门关联账号
    WebDepartmentUser selectById(@Param("id") Long id);

    //查询部门关联账号
    List<WebDepartmentUser> select(@Param("ew") QueryWrapper<WebDepartmentUser> query);

    //查询部门关联账号分页
    List<WebDepartmentUser> select(Page<WebDepartmentUser> page, @Param("ew") QueryWrapper<WebDepartmentUser> query);

    //查询部门关联账号数量
    int selectCount(@Param("ew") QueryWrapper<WebDepartmentUser> query);

    //删除关联账号信息
    int remove(WebDepartmentUser webDepartmentUser);
}
